﻿<UserControl x:Class="DllShepherd.SilverlightGoogleMaps.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:Controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"
             xmlns:Common="clr-namespace:DllShepherd.SilverlightGoogleMaps.Common"
             xmlns:res="clr-namespace:DllShepherd.SilverlightGoogleMaps.Web.Resources" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400">

    <UserControl.DataContext>
        <Binding Mode="OneWay" Path="Main" Source="{StaticResource Locator}"/>
    </UserControl.DataContext>
    
    <UserControl.Resources>
        <res:StringsResource x:Key="StringsRes" />
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot">

        <Common:MapControl BackgroundUrl="{Binding Path=Config.BackgroundUrl}" MapMousePosition="{Binding Path=MapMousePosition, Mode=TwoWay}">
            <Controls:ContextMenuService.ContextMenu >
                <Controls:ContextMenu>
                    <Controls:MenuItem Header="{Binding Path=StreetView, Source={StaticResource StringsRes}}"
                                               Command="{Binding ViewStreetCommand}"  >
                        <Controls:MenuItem.Icon>
                            <Image Source="Images/StreetViewLogo.png" Height="20" Width="20"/>
                        </Controls:MenuItem.Icon>
                    </Controls:MenuItem>
                </Controls:ContextMenu>
            </Controls:ContextMenuService.ContextMenu>
        </Common:MapControl>

    </Grid>
</UserControl>
